Sparse Bin Mat
A sparse implementation of a binary matrix optimized for row operations.
All elements in a binary matrix are element of the binary field GF2. That is, they are either 0 or 1 and addition is modulo 2.
Quick start
To instanciate a matrix, you need to specify the number of columns as well as the position of 1 in each rows.
use SparseBinMat;
// This is the matrix
// 1 0 1 0 1
// 0 1 0 1 0
// 0 0 1 0 0
let matrix = new;
It is easy to access elements or rows of a matrix. However, since the matrix are optimized for row operations, you need to transpose the matrix if you want to perform column operations.
let matrix = new;
assert_eq!;
assert_eq!;
assert_eq!;
// The element (0, 7) is out of bound for a 3 x 5 matrix.
assert_eq!;
Adition and multiplication are implemented between matrix references.
let matrix = new;
let identity = identity;
let sum = new;
assert_eq!;
assert_eq!;
Many useful operations and decompositions are implemented. These include, but are not limited to
- rank,
- echelon from,
- normal form,
- tranposition,
- horizontal and vertical concatenations,
- and more ...
Operations are implemented as I need them, feel welcome to raise an issue if you need a new functionnality.